# Contributor: knuxify <knuxify@gmail.com>
# Maintainer: knuxify <knuxify@gmail.com>
pkgname=tangram
pkgver=3.0
pkgrel=1
_troll_commit="63392a57392fb8ed944e859269a3751f649f64ec"
pkgdesc="Browser for your pinned tabs"
url="https://apps.gnome.org/app/re.sonny.Tangram"
# armhf: blocked by gjs
# s390x: blocked by gjs, blueprint-compiler
arch="noarch !armhf !s390x"
license="GPL-3.0-or-later"
depends="
	gjs
	gtk4.0
	libadwaita
	webkit2gtk-6.0
	"
makedepends="
	appstream-glib
	blueprint-compiler
	coreutils
	desktop-file-utils
	gjs-dev
	glib-dev
	gtk4.0-dev
	libadwaita-dev
	meson
	"
subpackages="$pkgname-lang"
source="https://github.com/sonnyp/Tangram/archive/refs/tags/v$pkgver/Tangram-$pkgver.tar.gz
	troll-$_troll_commit.tar.gz::https://github.com/sonnyp/troll/archive/$_troll_commit.tar.gz
	busybox.patch
	"
builddir="$srcdir/Tangram-$pkgver"
options="!check" # no test suite

prepare() {
	default_prepare

	rm -r "$builddir"/troll
	mv "$srcdir"/troll-$_troll_commit "$builddir"/troll
}

build() {
	abuild-meson \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
74fb84ecd18e80605f98582a0e42d8f7acf8c1e208895592ef6299f187a741ef8642237283bdcf164bf29ee6a1c73f528dfdde274f2f45278cbad118c38b6d42  Tangram-3.0.tar.gz
53f093712dd11cf2cc3e0448561b57873d225653bff937efa6a2e264ad3520b601cd623aa0178508e4a81e4f85c187dfc977f7f75bbd15873fce64b48efdcda8  troll-63392a57392fb8ed944e859269a3751f649f64ec.tar.gz
0312705a1a832da0ff26c89fd83769a6f1720917dd954cc1d43482daf386841a8a0cae3a4e8b45cbf6c2b7ac3dbf5eb888ed690a568ab48b1763cc727ad69ebe  busybox.patch
"
